import { getAction, deleteAction, putAction, postAction, httpAction, postFormData, postActionBlob } from '@/api/manage'
const gateway = '/gateway/api'
const jnby = '/jnby-boot'
const coupon = '/api/gateway'
const baseUrl = window._CONFIG['domianURL'] || '/jeecg-boot'

const addAndEditCoupon = (params) => postFormData(coupon + '/jic-backend-operation/office/voucher/sendPage', params) // 详情
const ruleList = (params) =>  postAction(coupon + '/jic-sdk-voucher-center/voucher/rule/list', params) // 获取券规则列表
const couponList = (params) =>  postFormData(coupon + '/jic-backend-operation/office/voucher/sendPage/list', params) // 发券列表
const sendUserList = (params) =>  postFormData(coupon + '/jic-backend-operation/office/voucher/list/sendUser', params) // 发券对象列表
const addSendUser = (params) =>  postFormData(coupon + '/jic-backend-operation/office/voucher/add/sendUser', params) // 单独添加发放对象
const sendPageAdd = (params) =>  postAction(coupon + '/jic-backend-operation/office/voucher/sendPage/add', params) // 发券确认
const submit = (params) =>  postAction(coupon + '/jic-backend-operation/office/voucher/page/submit', params) // 确认提交
const voucherCancel = (params) =>  postAction(coupon + '/jic-backend-operation/office/voucher/cancel', params) // 作废券
const sendPageInfoList = (params) =>  postFormData(coupon + '/jic-backend-operation/office/voucher/list/sendPageInfoList', params) // 发券明细列表
const deleteSendUser = (params) =>  postFormData(coupon + '/jic-backend-operation/office/voucher/delete/sendUser', params) // 删除发放对象
const printDetails = (params) =>  postAction(coupon + '/jic-backend-operation/office/voucher/print', params) // 打印详情
const voucherDelay = (params) =>  postAction(coupon + '/jic-backend-operation/office/voucher/delay', params) // 延期
const showPageCreate = (params) =>  postAction(coupon + '/jic-backend-operation/office/voucher/showPage/create', params) // 创建模板
const showPageList = (params) =>  postAction(coupon + '/jic-backend-operation/office/voucher/showPage/list', params) // 模板列表
const showPageEdit = (params) =>  postAction(coupon + '/jic-backend-operation/office/voucher/showPage/edit', params) // 编辑模板
const showPagDetail = (params) =>  postFormData(coupon + '/jic-backend-operation/office/voucher/showPage/detail', params) // 模板详情
const logToken = (params) =>  postAction(coupon + '/jic-backend-operation/office/voucher/log/token', params) // 快速添加
const logAddOne = (params) =>  postFormData(coupon + '/jic-backend-operation/office/voucher/log/addOne', params) // 单独添加
const logPage = (params) =>  postFormData(coupon + '/jic-backend-operation/office/voucher/log/page', params) // (打印/作废/延期)列表
const logDelete = (params) =>  postFormData(coupon + '/jic-backend-operation/office/voucher/log/delete', params) // (打印/作废/延期)删除
const logExpert = baseUrl + coupon +'/jic-backend-operation/office/voucher/log/expert' // (打印/作废/延期)批量添加
const sendUserExpert = baseUrl + coupon +'/jic-backend-operation/office/voucher/export/sendUser' // 新增-下载导入模板
const sendUserBatchAdd = baseUrl + coupon +'/jic-backend-operation/office/voucher/batchAdd/sendUser' // 新增批量添加
const vouchersCheck = (params) =>  postFormData(coupon + '/jic-backend-operation/office/voucher/vouchers/check', params) // 券号检测
const exportSendPageInfoByPageId = baseUrl + coupon +'/jic-backend-operation/office/voucher/export/sendPageInfoByPageId' // 下载明细
const logTemplateExpert = baseUrl + coupon +'/jic-backend-operation/office/voucher/export/log' // (打印/作废/延期)下载导入模板
const oaList = (params) =>  postAction(coupon + '/jic-backend-operation/office/voucher/oa/list', params) // 流程列表
const pageUpdate = (params) =>  postAction(coupon + '/jic-backend-operation/office/voucher/page/update', params) // 修改领券模板
const exportOfficeSends = baseUrl + coupon +'/jic-backend-operation/office/voucher/export/exportOfficeSends'// 下载汇总
const exportOfficeSendsDetails = baseUrl + coupon +'/jic-backend-operation/office/voucher/export/exportOfficeSendsDetails'// 下载核销明细
const officeLog = (params) =>  postAction(coupon + '/jic-backend-operation/office/voucher/officeLog/list', params) // 日志
export {
  addAndEditCoupon,
  ruleList,
  couponList,
  sendUserList,
  addSendUser,
  sendPageAdd,
  submit,
  voucherCancel,
  sendPageInfoList,
  deleteSendUser,
  sendUserExpert,
  sendUserBatchAdd,
  printDetails,
  voucherDelay,
  showPageCreate,
  showPageList,
  showPageEdit,
  logToken,
  logAddOne,
  logPage,
  logDelete,
  logExpert,
  vouchersCheck,
  exportSendPageInfoByPageId,
  showPagDetail,
  logTemplateExpert,
  oaList,
  pageUpdate,
  exportOfficeSends,
  officeLog,
  exportOfficeSendsDetails
}
